<template>
	<view class="bgw px6">
		<view class="tac py6">使用微信账号快捷登录ibot</view>
		<view class="h30 fjc fac">
			<image :lazy-load="true" class="w14 h14 br3" src="/static/logo.png" />
		</view>
		<button ref="getMobile" type="primary" open-type="getPhoneNumber" @getphonenumber="bindPhone">本机号一键绑定</button>
	</view>
</template>
<script lang="ts">
import {page, form} from '@/mixins'
import {mapActions} from 'pinia'
import {userStore} from '@/store'

export default {
	mixins: [page,form],
	data() {
		return {
			meta:{title:'绑定账号'},
			view: {mobile:'',nickname:'', password: '', repeat: ''},
			smscode: '',
			smsShow: false,
			formPath: 'bind',
			rules: {
				mobile: [{
					required: true,
					message: '请输入手机号',
					trigger: ['change', 'blur']
				}, {
					len: 11,
					message: '请输入11个字符',
					trigger: ['change', 'blur']
				}],
				password: [{
					required: true,
					message: '请输入密码',
					trigger: ['change', 'blur']
				}, {
					min: 6,
					max: 16,
					message: '6-16个字符',
					trigger: ['blur', 'change']
				}],
				repeat: [{
					required: true,
					message: '请输入密码',
					trigger: ['blur', 'change']
				}, {
					validator: (r, v) => v === this.view.password,
					message: '两次密码不一致',
					trigger: ['blur', 'change']
				}]
			}
		}
	},
	methods: {
		...mapActions(userStore, ['login']),
		bindPhone(){
			
		}
	}
}
</script>
